﻿<Window x:Class="Blabber.Client.WindowSettings"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Settings" Height="397" Width="534">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <Grid Margin="3">

            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>

            <Expander Grid.Row="1" HorizontalAlignment="Stretch" Header="Connection Details" IsExpanded="True">
                <Grid Name="detailGrid">
                    <Grid.RowDefinitions>
                        <RowDefinition />
                        <RowDefinition />
                        <RowDefinition />
                    </Grid.RowDefinitions>

                    <Grid.ColumnDefinitions>
                        <ColumnDefinition />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>

                    <StackPanel Margin="3">
                        <TextBlock>Connect Server</TextBlock>
                        <TextBox Text="{Binding ConnectServer}"></TextBox>
                    </StackPanel>
                    
                    <StackPanel Grid.Row="1" Margin="3">
                        <TextBlock>Server</TextBlock>
                        <TextBox Text="{Binding Server}"></TextBox>
                    </StackPanel>
                    
                    <StackPanel Grid.Row="2" Margin="3">
                        <TextBlock>Port</TextBlock>
                        <TextBox Text="{Binding Port}"></TextBox>
                    </StackPanel>
                    
                    <StackPanel Grid.Row="0" Grid.Column="1" Margin="3">
                        <TextBlock>User Name</TextBlock>
                        <TextBox Text="{Binding UserName}" Name="textBoxUserName"></TextBox>
                    </StackPanel>
                    
                    <StackPanel Grid.Row="1" Grid.Column="1" Margin="3">
                        <TextBlock>Password</TextBlock>
						<Grid>
							<Grid.ColumnDefinitions>
								<ColumnDefinition />
								<ColumnDefinition Width="Auto" />
							</Grid.ColumnDefinitions>
							
							<PasswordBox Name="passwordBox"></PasswordBox>
							<Button Margin="3,0,0,0" Grid.Column="1" Content="Set Password" Click="ButtonSetPassword_Click"></Button>
						</Grid>
					</StackPanel>

                    <Button Height="24" VerticalAlignment="Bottom" Grid.Row="2" Grid.Column="1" Margin="3" Content="Create New Connection" Click="ButtonNewConnection_Click"  />
                </Grid>
            </Expander>
            
            <TabControl>
                <TabItem Header="Connections">
                    <ListView Name="connectionListView" ItemsSource="{Binding}" IsSynchronizedWithCurrentItem="True">
                        <ListView.View>
                            <GridView>
                                <GridViewColumn DisplayMemberBinding="{Binding ConnectServer}" Width="200" Header="Server" />
                                <GridViewColumn DisplayMemberBinding="{Binding Port}" Width="100" Header="Port" />
                                <GridViewColumn DisplayMemberBinding="{Binding UserName}" Width="200" Header="User Name" />
                            </GridView>
                        </ListView.View>

                        <ListView.ContextMenu>
                            <ContextMenu>
                                <MenuItem Header="Delete Connection" Click="DeleteConnection_Click" />
                            </ContextMenu>
                        </ListView.ContextMenu>
                    </ListView>
                </TabItem>

                <!--<TabItem Header="General">
                
            </TabItem>-->
            </TabControl>
        </Grid>

        <!--<StackPanel HorizontalAlignment="Right" Grid.Row="1" Orientation="Horizontal">
            <Button Width="Auto" Padding="5,0,5,0" Margin="3,3,3,3" Content="Close" Click="ButtonOK_Click" />
        </StackPanel>-->
    </Grid>
</Window>
